<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
echo "<h2>Сортировка внутри бренда</h2>";
$this->table->set_heading('id', 'Название', 'Сортировка', 'Действия');
$tmpl = array('table_open' => '<table border="0" cellpadding="0" cellspacing="0" class="admin_table">');
$this->table->set_template($tmpl);

$class = 'brands';
if ($this->users_rights_model->check_rights($class, 'block', true)) $canblock = 1;
if ($this->users_rights_model->check_rights($class, 'unblock', true)) $canblock = 1;
if ($this->users_rights_model->check_rights($class, 'edit', true)) $canedit = 1;
if ($this->users_rights_model->check_rights($class, 'delete', true)) $candelete = 1;
if ($this->users_rights_model->check_rights($class, 'add', true)) $canadd = 1;

foreach ($pages as $page) {
	$this->table->add_row(
			$page['item_id'],
			$page['item_title'],
			array('data' => "<input class='ordering' type='text' tabindex='".$d."' value='".$page['item_brand_order']."' name='order[item][".$page['item_id']."]' />", 'style' => 'text-align: center;'),
			showmeactions(
					$class,
					$page['item_id'],
					$page['item_status'],
					0, 0, 0,
					$from
				)
		);
}
$this->table->add_row(
			"","",
			array('data' => "<input type='submit' tabindex='".$d."' class='ordering' value='Сохранить' />", 'style' => 'text-align: center; width: 80px;'),
			""
		);
echo "<form action='/admin/brands/brand_order/".$this->uri->segment(4)."' method='post'>";
echo $this->table->generate();
echo "</form>";
echo $paging;
echo "<div class='cc'></div>";
?>
